import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@views/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/cates',
    name: 'Cates',
    component: () => import('@views/Cates')
  },
  {
    path: '/phone',
    name: 'Phone',
    component: () => import('@views/Phone')
  },
  {
    path: '/carts',
    name: 'Carts',
    component: () => import('@views/Carts')
  },
  {
    path: '/users',
    name: 'Users',
    component: () => import('@views/Users')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
